Mac OS X USB User Space Sample Code

This directory contains three example XCode projects for writing USB drivers which operate in User Space.

USBSimpleExample

This project shows the basics of how to connect to and communicate with a USB device from User Space. It is written as a standard Unix tool.

USBNotificationExample

This project shows how to use the IOKit notification mechanism to register to be notified when devices come and go. It uses the Cypress/Anchor EZ-USB chip. (Look at the following example for another way to get notified when a device is unplugged).

Another USB Notification Example

Another sample that demonstrates how to use IOKitLib and IOUSBLib to set up asynchronous  callbacks when a USB device is attached to or removed from the system is located at:

http://developer.apple.com/samplecode/USBPrivateDataSample/index.html

It also shows how to associate arbitrary data with each device instance (which can be used to distinguish between identical devices).

Last modified: 10-May-2007